package one.stand.enums;

import java.util.Map;

/**
 * 客户类型
 *
 * @author Administrator
 */
public enum CustomerStateEnums {
    /**
     *
     */
    MONOPOLY(1, "独占客户"),
    /**
     *
     */
    SHARE(2, "共享客户"),
    /**
     *
     */
    SINGLE(3, "成单客户");
    private Integer code;
    private String message;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    CustomerStateEnums(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    private static Map<Integer, CustomerStateEnums> codeMap = EnumUtil.getEnumMap(values(), CustomerStateEnums::getCode);

    public static CustomerStateEnums getByCode(Integer code) {
        return codeMap.get(code);
    }
}
